const babelCore = require('@babel/core')

const code = `
  typeof Symbol() === "symbol";
`
const result = babelCore.transformSync(code, {
  plugins: ["@babel/plugin-transform-typeof-symbol"]
})

console.log(result.code);